import request from '@/utils/request'

// 查询开具处方列表
export function listPrescription(query) {
  return request({
    url: '/emr/add_prescription/list',
    method: 'get',
    params: query
  })
}

// 查询开具处方详细
export function getPrescription(id) {
  return request({
    url: '/emr/add_prescription/' + id,
    method: 'get'
  })
}

// 开具处方
export function addPrescription(data) {
  return request({
    url: '/emr/add_prescription/save',
    method: 'post',
    data: data
  })
}


// 查询病历列表
export function listRecordInfo(query) {
  return request({
    url: '/emr/add_prescription/record_info',
    method: 'get',
    params: query
  })
}

//向处方信息添加药品
export function addDrugToPrescription(data) {
  return request({
    url: '/emr/add_prescription/save_drugs',
    method: 'post',
    data: data
  })
}

// 修改处方
export function updatePrescription(data) {
  return request({
    url: '/emr/add_prescription',
    method: 'put',
    data: data
  })
}